package com.jh.concurrent.juc.cyclicbarrier;

import java.util.concurrent.CyclicBarrier;

/**
 * @author JH_Wong
 * @projectName newforward
 * @title
 * @package com.jh.concurrent.juc.cyclicbarrier
 * @description
 * @date 2019-05-21 09:17
 */
public class CyclicBarrierDemo extends Thread{

    @Override
    public void run() {
        System.out.println("数据导入完毕！");
    }

    public static void main(String[] args) {
        CyclicBarrier cyclicBarrier = new CyclicBarrier(3, new CyclicBarrierDemo());
        new Thread(new DataImportThread(cyclicBarrier, "file1")).start();
        new Thread(new DataImportThread(cyclicBarrier, "file2")).start();
        new Thread(new DataImportThread(cyclicBarrier, "file3")).start();
    }
}
